<div id="addnew_hotel"></div>
<div id="hotels_table">
  <%= link_to 'Add New', new_hotel_path, class: "btn btn-primary", remote: true %> <br/> <br/>

  <table class="table">
    <thead>
      <tr>
        <th><%= sortable "hotel_name" %></th>
        <th><%= sortable "area_id" %></th>
        <th style="text-align:center;">Status</th>
        <th style="text-align:center;" colspan="3">Option</th>
        <th style="text-align:center;" colspan="2">Action</th>
      </tr> 
    </thead>

    <tbody id="hotels">
      <% @hotels.each do |hotel| %>
        <tr>
          <td><%= hotel.hotel_name %><br/><%= image_tag hotel.primary_picture.url(:thumb) %></td>
          <td class="text-center"><%= hotel.area.area unless hotel.area.blank? %></td>
          <td class="text-center">
            <span class="<%= (hotel.is_published == false) ? raw('label label-important') : raw('label label-success') %>"><%= (hotel.is_published == true) ? raw('Published') : raw('Not Published') %></span><br/> <br/>
            <span class="<%= (hotel.is_on_promoted == false) ? raw('label label-important') : raw('label label-success') %>"><%= (hotel.is_on_promoted == true) ? raw('Promoted') : raw('Not Promoted') %></span><br/> <br/>
            <span class="<%= (hotel.is_recomended == false) ? raw('label label-important') : raw('label label-success') %>"><%= (hotel.is_recomended == true) ? raw('Recomended') : raw('Not Recomended') %></span><br/> <br/>
          </td>
          <td class="text-center"><%= link_to "Facilities", {controller: "hotels", action: "facility_list", hotel_id: hotel.id}, remote: true %></td>
          <td class="text-center"><%= link_to "Rooms", hotel_room_types_path({ hid: hotel.id }), remote: true %></td>
          <td class="text-center"><%= link_to "Images", hotel_images_path({ hid: hotel.id }), remote: true %></td> 
          <td class="text-center">
            <%= link_to 'Edit', edit_hotel_path(hotel), remote: true %> | 
            <%= link_to 'Delete', hotel, method: :delete, remote: true, data: { confirm: 'Are you sure?' } %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>


  <div class="collection_paginator">
    <%#= will_paginate hotels %>
  </div>

</div>